<!DOCTYPE html>
<#assign ctx=request.contextPath>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="${ctx}/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/css/style.css" />
    <script type="text/javascript" src="${ctx}/js/jquery.js"></script>
    <script type="text/javascript" src="${ctx}/js/ckform.js"></script>
    <script type="text/javascript" src="${ctx}/js/common.js"></script>
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
    </style>
    <script type="text/javascript">
        $(function(){
             $("#addGoods").click(function(){
                  window.location="${ctx}/admin/goods/showAddGoods";
             });
        });   
    </script>
    
    
    
    
</head>
<body>
<form class="form-inline definewidth m20" action="${ctx}/admin/goods/showGoodsList" method="post">    
    用户名称：
    <input type="text" name="title" id="username"class="abc input-default" placeholder="" value="">&nbsp;&nbsp;  
    <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp; <button type="button" class="btn btn-success" id="addGoods">新增商品</button>
</form>
<table class="table table-bordered table-hover definewidth m10">
    <thead>
    <tr>
        <th>商品编号</th>
        <th>商品名称</th>
        <th>品牌名称</th>
        <th>价格</th>
        <th>优惠价</th>
        <th>上架日期</th>
        <th>库存</th>
        <th>商品封面</th>
        <th>商品描述</th>
        <th>商品类型</th>
        <th>创建日期</th>
        <th colspan="2" style="text-align:center">操作</th>
    </tr>
    </thead>
         <#if goodsList??>
         <#list goodsList as goods>
	     <tr>
            <td>${goods.id}</td>
            <td>${goods.title}</td>
            <td>${goods.brandName}</td>
            <td>${goods.price}</td>
            <td>${goods.favorablePrice}</td>
            <td>${goods.groundingDate?string('yyyy-MM-dd')}</td>
            <td>${goods.storage}</td>
            <td>${goods.image}</td>
            <td>${goods.description}</td>
            <td>${goods.goodsType.code}</td>
            <td>${goods.createDate?string('yyyy-MM-dd')}</td>
            <td>
                  <a href="${ctx}/admin/user/showUpdate?id=">修改</a>
            </td>
             <td>
                  <a href="${ctx}/admin/goods/deleteGoods?id=${goods.id}" style="color:blue;">删除</a>
             </td>
        </tr>
        </#list>
        </#if>	
</table>
<#if pageModel.recordCount??>
		<!-- 分页标签-->
		<div id="pagerInfo" style="margin:5px 0px; 
		text-align:center;background-color:#FFFF00;color:blue">
  		共${pageModel.recordCount}条,
  		分${((pageModel.recordCount+pageModel.pageSize -1)/pageModel.pageSize)?int}页
  		</div>
  	 	<div id="pager">
  		<#import "../common/pager.html" as page>
  		<@page.pager pageIndex=pageModel.pageIndex pageSize=pageModel.pageSize 
  		recordCount=pageModel.recordCount toURL="${ctx}/admin/goods/showGoodsList"/>
    	</div>
</#if>
</body>
</html>
</script>